<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Template {
		var $template_data = array();
		
		function set($name, $value)
		{
			$this->template_data[$name] = $value;
		}
	
		function load($template = '', $view = '' , $view_data = array(), $return = FALSE)
		{               
			$this->CI =& get_instance();
			$this->set('contents', $this->CI->load->view($view, $view_data, TRUE));			
			// navigation list
			$this->set('nav_list', array(
									'dashboard'		=>	'<span class="glyphicon glyphicon-home"></span> Dashboard',
									'order'			=>  '<span class="glyphicon glyphicon-list"></span> Đơn hàng',
									//'products'		=>  '<span class="glyphicon glyphicon-book"></span> Sản phẩm',
									'storagemanage'	=>  '<span class="glyphicon glyphicon-list-alt"></span> Số lượng áo',
									'conversion'	=>	'<span class="glyphicon glyphicon-barcode"></span> Bảng quy đổi',
									'importw' 		=>  '<span class="glyphicon glyphicon-import"></span> Nhập kho',
									'exportw' 		=>  '<span class="glyphicon glyphicon-export"></span> Xuất kho', 										
									'user' 			=>  '<span class="glyphicon glyphicon-user"></span> Người dùng', 
									'setting'		=>	array(
											'setting'				=>	'<span class="glyphicon glyphicon-wrench"></span> Web Setting',
											'user/changeAdminPass'	=>	'<span class="glyphicon glyphicon-lock"></span> Thay đổi mật khẩu',
											//'http://shop.aothun.vn/export/aothunvn/export/import.php'	=> '<span class="glyphicon glyphicon-save"></span> Nhập bảng quy đổi',
											'importw/history'		=>	'<span class="glyphicon glyphicon-floppy-save"></span> Lịch sử nhập kho',
											'exportw/history'		=>	'<span class="glyphicon glyphicon-floppy-open"></span> Lịch sử xuất kho',
											'cron/history'			=>	'<span class="glyphicon glyphicon-hdd"></span> Lịch sử backup dữ liệu',
										),						
									'login/logout'		=>	'<span class="glyphicon glyphicon-log-out"></span> Thoát',
									));
			return $this->CI->load->view($template, $this->template_data, $return);
		}

		// for affiliate
		function load_main($template = '', $view = '' , $view_data = array(), $return = FALSE)
		{
			$this->CI =& get_instance();
			$this->set('contents', $this->CI->load->view($view, $view_data, TRUE));

			$this->set('nav_list', array(
										'affiliate'		=> '<span class="glyphicon glyphicon-home"></span> Dashboard', 
										'orderaff'			=> '<span class="glyphicon glyphicon-th-list"></span> Đơn hàng', 
										'settingaff'		=> '<span class="glyphicon glyphicon-wrench"></span> Cài đặt', 
										// 'notifyaff'			=> '<span class="glyphicon glyphicon-comment"></span> Thông báo',
										'login/logout'		=>	'<span class="glyphicon glyphicon-log-out"></span> Thoát',
										)
					  );

			return $this->CI->load->view($template, $this->template_data, $return);			
		}

		// for homepage
		function load_homepage($template = '', $view = '' , $view_data = array(), $return = FALSE)
		{
			$this->CI =& get_instance();
			$this->set('contents', $this->CI->load->view($view, $view_data, TRUE));

			$this->set('nav_list', array(
										'affiliate'		=> '<span class="glyphicon glyphicon-home"></span> Dashboard', 
										'orderaff'			=> '<span class="glyphicon glyphicon-th-list"></span> Đơn hàng', 
										'settingaff'		=> '<span class="glyphicon glyphicon-wrench"></span> Cài đặt', 
										// 'notifyaff'			=> '<span class="glyphicon glyphicon-comment"></span> Thông báo',
										'login/logout'		=>	'<span class="glyphicon glyphicon-log-out"></span> Thoát',
										)
					  );

			return $this->CI->load->view($template, $this->template_data, $return);			
		}
}

/* End of file Template.php */
/* Location: ./system/application/libraries/Template.php */